<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>乘法表</title>
    <style>
        table{
            border-collapse: collapse;
            /* 边框不包裹内容的话,折叠*/
        }
    </style>
    <script >
        /*
        * 99乘法表:
        *   外层循环 for i=1~9  //行
        *   内层循环 for j=1~i // 列
        * */
        /*
        *   js字符串用双引, html属性值用单引
        * */
        document.write("<table border=\"1px\" cellspacing='0px' cellpadding='5px'")
        for (let i=1; i<=9; i++){
            document.write("<tr>")
            for(let j=1; j<=i; j++){
                document.write("<td>")
                document.write(j+"x"+i+"="+i*j)
                document.write("</td>")
            }
            // document.write("<br>")
            document.write("</tr>")
        }
        document.write("</table>")
    </script>
</head>
<body>
    
</body>
</html>